function [mant,expnt] = mantexpnt(arg)
% MANTEXPNT
% Returns the mantissa and exponent of a real base 10 argument.
% FILENAME: mantexpnt.m

sgn = sign(arg);
expnt = fix(log10(abs(arg)));
mant = sgn.*10.^(log10(abs(arg))-expnt);

if any(abs(mant) < 1)
    temp_mant = mant;

    mant = mant.*(~(abs(temp_mant) < 1)) + mant.*(abs(temp_mant) < 1) * 10;
    expnt = expnt.*(~(abs(temp_mant) < 1)) + (expnt.*(abs(temp_mant) < 1) - 1.*(abs(temp_mant) < 1));
end

mant(isnan(mant)) = 0;
expnt(isnan(expnt)) = 0;

end